<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
	<head>
		<script type="text/javascript">
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
        function notAllowedLockSelf(id){           
            var searchForm=document.getElementById("searchForm");
            searchForm.action="userAction-"+id+"!lock.action";
            searchForm.submit();            
        }
        
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){            	
            	var searchForm=document.getElementById("searchForm");
            	searchForm.action="nspLoggerAction-"+id+"!toEdit.action";
            	searchForm.submit();
                return true;
            }else{
                alert("请选择一条记录");
                return false;
            }
        }        
        
        function validateDelete(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定所选择？');
            }else{
                alert("请先择你要删除的内容!!");
                return false;
            }
        }

        function doDelete(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='nspLoggerAction!delete.action';
            searchForm.submit();
            return true;
        }
        
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
        function seachInfo(obj) {
        	var url = "";

			url = "nspLoggerAction!getSearchInfo.action?query_requestType_seach="+obj;

			openWindow(url, 850, 500);
        }
        
        function chart(obj){
        	var url = "";
        	url = "nspLoggerCountJFreeChartAction!countNspLoggerJFreeChartQuery.action?query_requestType_seach="+obj;
        	
        	openWindow(url, 1000, 800);
        }
        
    </script>
	</head>
	<body onload="displayResult()">
		<s:form method="post" action="nspLoggerAction!countNspLogger.action"
			theme="simple" id="searchForm">
			<div id="div_title">
				<h3>
					NSP日志数据统计
				</h3>
				<div id="div_search">
					<table>
						<tr>
							<!-- 查询条件 -->
							
							
							<td width="80" align="right">
								请求时间:
							</td>
							
							<td>
								<s:textfield id="query_requestTime" name="query_requestTime" label="日期"
									onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
									- <s:textfield id="query_requestTime_end" name="query_requestTime_end" label="日期"
									onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
							
							</td>
							<td width="80" align="right">
								请求类型:
							</td>
							<td>
							<s:select list="requestTypeMap" headerKey=""  headerValue="-全部-"
										name="query_requestType" id="query_requestType"
										value="query_requestType" >
						         </s:select>
							
								
							</td>
						
							
							<td width="80" align="right">
								请求信息:
							</td>
							<td>
								<s:textfield name="query_requestInfo" />
							</td>
							
						</tr>
						<tr>						
							<td width="80" align="right">
								响应代码:
							</td>
							<td>
								<s:select list="responseCodeMap" headerKey=""  headerValue="-全部-"
										name="query_responseCode" id="query_responseCode"
										value="query_responseCode" >
						         </s:select>
							</td>
							
							<td width="80" align="right">
								响应信息:
							</td>
							<td>
								<s:textfield name="query_responseInfo" />
							</td>							
						
							
							<td width="80" align="right">
								<authz:authorize ifAnyGranted="OMC_NSP_LOG_COUNT">
									<s:submit cssClass="submit_search" value="搜索"
										action="nspLoggerAction!countNspLogger" />
								</authz:authorize>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			
			
			<!--列表 �?�� -->
			<table cellpadding="0" cellspacing="0" class="t_list">
				<tr>
				
					<!--列表头部 -->
					<th>
						类型
					</th>	
					<th>
						合作公司
					</th>
					<th>
						APP名称
					</th>
					<th>
						接入类型
					</th>
					<th>
						接入状态
					</th>				
					<th>
						总访问次数
					</th>
					<th>
						有效访问次数
					</th>
					<th>
						无效访问次数
					</th>
					<th>
						收费用户访问次数
					</th>
					<th>
						BDC数据访问次数
					</th>
					<th>
						详细数据
					</th>			
				</tr>
				<s:iterator value="resultList" status="sindex">
					<tr>
						<td>
							<s:property value="REQUEST_TYPE" />
						</td>
						<td>
							<s:property value="COMPANY" />
						</td>
						<td>
							<s:property value="APP_NAME" />
						</td>
						<td>
							<s:property value="TYPE" />
						</td>
						<td>
							<s:property value="STATUS" />
						</td>
						<td>
							<s:property value="ALLSUM" />
						</td>
						<td>
							<s:property value="VALIDCOUNT" />
						</td>
						<td>
							<s:property value="INVALIDCOUNT" />
						</td>
						<td>
							<s:property value="PAYUSERCOUNT" />
						</td>
						<td>
							<s:property value="BDCDATACOUNT" />
						</td>
						<td>
						<a href="javaScript:;" onclick="seachInfo('<s:property value="REQUEST_TYPE" />')">详细</a>
						<a href="javaScript:;" onclick="chart('<s:property value="REQUEST_TYPE" />')">图表</a>
						</td>					
					</tr>
				</s:iterator>
			</table>
			<!--列表 结束 -->
			

		</s:form>
	</body>
</html>
